Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Ensure LF line endings are used upon git checkout. #347

Closed
wants to merge 1 commit into from
Closed

Ensure LF line endings are used upon git checkout. #347

wants to merge 1 commit into from

Conversation

ChrisMBarr
Copy link
Contributor

Getting latest from master and simply running grunt all on my Windows 10 machine produced a lot of linting errors about line endings

lots of errors

quick google brought me to this page, where I added the line line to the .gitattrubutes file (which is the only change in this PR) & then ran the commands to refresh my local repo with the new settings, and now I get zero errors.

no errors no

@msftclas
Copy link

@ChrisMBarr, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.

Thanks, Microsoft Pull Request Bot

@bgold09
Copy link
Member

bgold09 commented Mar 16, 2017

@ChrisMBarr wanted to let you know that the appveyor build is failing because it is brand new. My PR #350 is addressing this by introducing a proper appveyor configuration; until then, you can safely ignore these failures.

@HamletDRC
Copy link
Member

This change doesn't actually fix the problem, right? When you initially clone the repo there is not yet a .gitattributes file so you'll get the files using your default line endings. This is why the README asks that you clone the repo with this command:

git clone [email protected]:Microsoft/tslint-microsoft-contrib.git --config core.autocrlf=input --config core.eol=lf

I guess I can commit this, but it doesn't really fix the problem when cloning the repo.

@HamletDRC
Copy link
Member

In other words, I think your changes here will "Ensure LF line endings are used upon a git pull" but they will not "Ensure LF line endings are used upon git checkout".

@ChrisMBarr
Copy link
Contributor Author

Ah ok, that makes sense. My process here was to:

  1. pull
  2. get lint errors
  3. make the commit in this PR
  4. follow these instructions
    • run git rm --cached -r .
    • run git reset --hard

Doing all of that worked for me.

@HamletDRC
Copy link
Member

If you don't clone with the right parameters then you're going to need to do the --cached --hard thing regardless.

@HamletDRC HamletDRC closed this Mar 17, 2017
@HamletDRC HamletDRC added this to the None milestone Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants